﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CMS.Views
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainView : Window
    {
        public MainView()
        {
            InitializeComponent();
            btn_Close.Click += (s, e) => { this.Close(); };
            btn_Min.Click += (s, e) => { this.WindowState = WindowState.Minimized; };
            btn_Max.Click += (s, e) => { if (this.WindowState == WindowState.Normal) this.WindowState = WindowState.Maximized; 
                else this.WindowState = WindowState.Normal; };
            bar.MouseDoubleClick += (s, e) =>
            {
                if (this.WindowState == WindowState.Normal) this.WindowState = WindowState.Maximized;
                else this.WindowState = WindowState.Normal;
            };
            bar.MouseMove += (s, e) =>
            {
                if(e.LeftButton==MouseButtonState.Pressed)
                this.DragMove();
            };
        }
    }
}
